home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Magazine Collection 2001
/
Delphi Magazine Collection 20001 (2001).iso
/
DISKS
/
Issue45
/
Clinic
/
ClientForm2U.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2000-11-02
|
1KB
|
52 lines
unit ClientForm2U;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Server_Stub2;
type
TForm1 = class(TForm)
Timer1: TTimer;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
public
Server: ITest;
end;
var
Form1: TForm1;
implementation
uses
CorbaObj;
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
var
Factory: ITestFactory;
begin
Factory := CorbaBind('IDL:Server/TestFactory:1.0') as ITestFactory;
Server := Factory.CreateInstance('');
Timer1.Enabled := True
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
try
Label1.Caption := DateTimeToStr(Server.Get_DateAndTime)
except
on E: Exception do
begin
Timer1.Enabled := False;
Label1.Caption := Format('Server not available (an %s exception occurred, saying "%s")', [E.ClassName, E.Message])
end
end
end;
end.